/*
package com.itheima.admin.security;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class MyAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
    private String type;

    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
                                        Authentication authentication) throws IOException, ServletException {
        logger.info("登录成功");
        System.out.println(request.getRequestURI());
        //返回json格式数据
        response.setContentType("application/json;charset=UTF-8");
        response.getWriter().write("{\"flag\":true,\"message\":\"登录成功\"}");
        //super.onAuthenticationSuccess(request, response, authentication);

    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }

}
*/
